<?php
	function getlogoExtension($fichier){
		if($fichier!=""){
			$extent=substr($fichier,-3); //echo $extent; die();
			switch ($extent){
				case 'pdf':
					$logo='pdflogo';
					break;
				case 'doc':
					$logo='wordlogo';
					break;
				case 'ppt':
					$logo='powerpointlogo';
					break;
				case 'rar':
					$logo='winrarlogo';
					break;
				default:
					$logo='unknown';
			}
		}else{
			$logo='unknown';
		}
		return $logo;
	}
	
	function getFaq(){
		return Doctrine_core::getTable('faq')->executeFaq(sfConfig::get('app_max_faq_left')); 
	}
	
	function getSondageActif(){
		return Doctrine_core::getTable('sondage')->getSondage(); 
	}
	
	function getBestRubrique(){
		return Doctrine_core::getTable('rubrique')->getBestVisitRubrique(6); 
	}
	
	function getNewUser(){
		return Doctrine_core::getTable('sfGuardUser')->getNewMember(true,6); 
	}
        function getPageGarde(){
           $result= Doctrine_core::getTable('journal')->getJournalEncours();
           $data= array();
           foreach($result as $journal){
              $data[] =$journal->getId();              
              $data[] =$journal->getTitre();
              $data[] =$journal->getImageJ();
              $data[] =$journal->getSlug();
           }
           return $data;
        }
?>